<html>
<head>

    <meta charset="utf-8">
    <!-- 引入 ECharts 文件 -->
    <script src="/echarts/echarts.min.js"></script>
    <script src="/echarts/jquery-1.10.2.js"></script>
    <script src="/echarts/dataTool.min.js"></script>
    <script>



    </script>


</head>
<body>
<button id="bn0" onclick="bn0()">
    战狼
</button>
<button id="bn1" onclick="bn1()">
    天龙八部
</button>
<button id="bn2" onclick="bn2()">
    电影类型偏好
</button>
<button id="bn3" onclick="bn3()">
    职业分类
</button>
<button id="bn4" onclick="bn4()">
    类型走势
</button>
<button id="bn5" onclick="bn5()">
    微博转发关系
</button>
<div id="main" style="width: 1000px;height:1000px;"></div>
<div id="main1" style="width: 1000px;height:900px;"></div>
<div id="main2" style="width: 1000px;height:900px;"></div>
<div id="main3" style="width: 1000px;height:900px;"></div>
<script type="text/javascript">





//    var myChart = echarts.init(document.getElementById('main'));
    // 基于准备好的dom，初始化echarts实例
    option0 = {
        backgroundColor: new echarts.graphic.RadialGradient(0.3, 0.3, 0.8, [{
            offset: 0,
            color: '#f7f8fa'
        }, {
            offset: 1,
            color: '#ffffff'
        }]),
        title: {
            text: "战狼II",
            subtext: "Wolf Warrior 2",
            top: "top",
            left: "center"
        },
        tooltip: {},
        legend: [{
            formatter: function(name) {
                return echarts.format.truncateText(name, 40, '14px Microsoft Yahei', '…');
            },
            tooltip: {
                show: true
            },
            selectedMode: 'false',
            bottom: 20,
            data: ['主演', '编剧', '制作人', '出品人', '策划', '导演', '配角', '动作指导', '后期导演']
        }],
        toolbox: {
            show: true,
            feature: {
                dataView: {
                    show: true,
                    readOnly: true
                },
                restore: {
                    show: true
                },
                saveAsImage: {
                    show: true
                }
            }
        },
        animationDuration: 3000,
        animationEasingUpdate: 'quinticInOut',
        series: [{
            name: '战狼II',
            type: 'graph',
            layout: 'force',

            force: {
                repulsion: 300
            },
            data: [{
                "name": "战狼II",
                // "x": 0,
                // y: 0,
                "symbolSize": 100,
                "draggable": "true",
                "value": 0

            }, {
                "name": "主演",
                "symbolSize": 80,
                "category": "主演",
                "draggable": "true",
                "value": 1
            }, {
                "name": "张翰",
                "symbolSize": 45,
                "category": "主演",
                "draggable": "true",
                "value": 14
            }, {
                "name": "卢靖姗",
                "symbolSize": 45,
                "category": "主演",
                "draggable": "true",
                "value": 15
            }, {
                "name": "弗兰克·格里罗",
                "symbolSize": 50,
                "category": "主演",
                "draggable": "true",
                "value": 12
            }, {
                "name": "吴京",
                "symbolSize": 60,
                "category": "主演",
                "draggable": "true",
                "value": 11
            }, {
                "name": "吴刚",
                "symbolSize": 50,
                "category": "主演",
                "draggable": "true",
                "value": 13
            }, {
                "name": "编剧",
                "value": 3,
                "symbolSize": 60,
                "category": "编剧",
                "draggable": "true"
            }, {
                "name": "董群",
                "symbolSize": 30,
                "category": "编剧",
                "draggable": "true",
                "value": 31
            }, {
                "name": "刘毅",
                "symbolSize": 30,
                "category": "编剧",
                "draggable": "true",
                "value": 32
            }, {
                "name": "制作人",
                "value": 5,
                "symbolSize": 40,
                "category": "制作人",
                "draggable": "true"
            }, {
                "name": "关海龙",
                "symbolSize": 30,
                "category": "制作人",
                "draggable": "true",
                "value": 501
            }, {
                "name": "张苗",
                "symbolSize": 30,
                "category": "制作人",
                "draggable": "true",
                "value": 502
            }, {
                "name": "嵇道表",
                "symbolSize": 30,
                "category": "制作人",
                "draggable": "true",
                "value": 503
            }, {
                "name": "梁仁红",
                "symbolSize": 30,
                "category": "制作人",
                "draggable": "true",
                "value": 504
            }, {
                "name": "冯郇",
                "symbolSize": 30,
                "category": "制作人",
                "draggable": "true",
                "value": 505
            }, {
                "name": "陈永雄",
                "symbolSize": 30,
                "category": "制作人",
                "draggable": "true",
                "value": 506
            }, {
                "name": "郑剑锋",
                "symbolSize": 30,
                "category": "制作人",
                "draggable": "true",
                "value": 507
            }, {
                "name": "陈静",
                "symbolSize": 30,
                "category": "制作人",
                "draggable": "true",
                "value": 508
            }, {
                "name": "成丽",
                "symbolSize": 30,
                "category": "制作人",
                "draggable": "true",
                "value": 509
            }, {
                "name": "梁颖",
                "symbolSize": 30,
                "category": "制作人",
                "draggable": "true",
                "value": 510
            }, {
                "name": "出品人",
                "value": 6,
                "symbolSize": 35,
                "category": "出品人",
                "draggable": "true"
            }, {
                "name": "吕建民",
                "symbolSize": 20,
                "category": "出品人",
                "draggable": "true",
                "value": 61
            }, {
                "name": "徐子泉",
                "symbolSize": 20,
                "category": "出品人",
                "draggable": "true",
                "value": 62
            }, {
                "name": "俞白眉",
                "symbolSize": 20,
                "category": "出品人",
                "draggable": "true",
                "value": 63
            }, {
                "name": "喇培康",
                "symbolSize": 20,
                "category": "出品人",
                "draggable": "true",
                "value": 64
            }, {
                "name": "薛继军",
                "symbolSize": 20,
                "category": "出品人",
                "draggable": "true",
                "value": 65
            }, {
                "name": "于冬",
                "symbolSize": 20,
                "category": "出品人",
                "draggable": "true",
                "value": 66
            }, {
                "name": "曾茂军",
                "symbolSize": 20,
                "category": "出品人",
                "draggable": "true",
                "value": 67
            }, {
                "name": "杨伟东",
                "symbolSize": 20,
                "category": "出品人",
                "draggable": "true",
                "value": 68
            }, {
                "name": "策划",
                "value": 7,
                "symbolSize": 30,
                "category": "策划",
                "draggable": "true"
            }, {
                "name": "鲍晓曦",
                "symbolSize": 20,
                "category": "策划",
                "draggable": "true",
                "value": 701
            }, {
                "name": "江平",
                "symbolSize": 20,
                "category": "策划",
                "draggable": "true",
                "value": 702
            }, {
                "name": "赵海城",
                "symbolSize": 20,
                "category": "策划",
                "draggable": "true",
                "value": 702
            }, {
                "name": "李洋",
                "symbolSize": 20,
                "category": "策划",
                "draggable": "true",
                "value": 703
            }, {
                "name": "赵建军",
                "symbolSize": 20,
                "category": "策划",
                "draggable": "true",
                "value": 704
            }, {
                "name": "许志湧",
                "symbolSize": 20,
                "category": "策划",
                "draggable": "true",
                "value": 705
            }, {
                "name": "蒋德富",
                "symbolSize": 20,
                "category": "策划",
                "draggable": "true",
                "value": 706
            }, {
                "name": "刘开珞",
                "symbolSize": 20,
                "category": "策划",
                "draggable": "true",
                "value": 707
            }, {
                "name": "邓浩",
                "symbolSize": 20,
                "category": "策划",
                "draggable": "true",
                "value": 708
            }, {
                "name": "吴燕",
                "symbolSize": 20,
                "category": "策划",
                "draggable": "true",
                "value": 709
            }, {
                "name": "凌江",
                "symbolSize": 20,
                "category": "策划",
                "draggable": "true",
                "value": 710
            }, {
                "name": "崔洁",
                "symbolSize": 20,
                "category": "策划",
                "draggable": "true",
                "value": 711
            }, {
                "name": "孙文杰",
                "symbolSize": 20,
                "category": "策划",
                "draggable": "true",
                "value": 712
            }, {
                "name": "陈庆奕",
                "symbolSize": 20,
                "category": "策划",
                "draggable": "true",
                "value": 713
            }, {
                "name": "曲吉小江",
                "symbolSize": 20,
                "category": "策划",
                "draggable": "true",
                "value": 714
            }, {
                "name": "朱昊",
                "symbolSize": 20,
                "category": "策划",
                "draggable": "true",
                "value": 715
            }, {
                "name": "刘红焰",
                "symbolSize": 20,
                "category": "策划",
                "draggable": "true",
                "value": 716
            }, {
                "name": "韩璐",
                "symbolSize": 20,
                "category": "策划",
                "draggable": "true",
                "value": 717
            }, {
                "name": "秀一",
                "symbolSize": 20,
                "category": "策划",
                "draggable": "true",
                "value": 718
            }, {
                "name": "导演",
                "value": 4,
                "symbolSize": 50,
                "category": "导演",
                "draggable": "true"
            }, {
                "name": "配角",
                "value": 2,
                "symbolSize": 70,
                "category": "配角",
                "draggable": "true"
            }, {
                "name": "丁海峰",
                "symbolSize": 40,
                "category": "配角",
                "draggable": "true",
                "value": 201
            }, {
                "name": "于谦",
                "symbolSize": 40,
                "category": "配角",
                "draggable": "true",
                "value": 202
            }, {
                "name": "淳于珊珊",
                "symbolSize": 40,
                "category": "配角",
                "draggable": "true",
                "value": 203
            }, {
                "name": "余男",
                "symbolSize": 40,
                "category": "配角",
                "draggable": "true",
                "value": 204
            }, {
                "name": "石兆琪",
                "symbolSize": 20,
                "category": "配角",
                "draggable": "true",
                "value": 205
            }, {
                "name": "狄安娜·希拉",
                "symbolSize": 40,
                "category": "配角",
                "draggable": "true",
                "value": 206
            }, {
                "name": "宋歌",
                "symbolSize": 20,
                "category": "配角",
                "draggable": "true",
                "value": 207
            }, {
                "name": "Nwachukwu Kennedy Chukwuebuka",
                "symbolSize": 40,
                "category": "配角",
                "draggable": "true",
                "value": 208
            }, {
                "name": "安·詹姆斯",
                "symbolSize": 20,
                "category": "配角",
                "draggable": "true",
                "value": 209
            }, {
                "name": "高明",
                "symbolSize": 20,
                "category": "配角",
                "draggable": "true",
                "value": 210
            }, {
                "name": "社建桥",
                "symbolSize": 20,
                "category": "配角",
                "draggable": "true",
                "value": 211
            }, {
                "name": "郭秋成",
                "symbolSize": 20,
                "category": "配角",
                "draggable": "true",
                "value": 212
            }, {
                "name": "程素",
                "symbolSize": 20,
                "category": "配角",
                "draggable": "true",
                "value": 213
            }, {
                "name": "孙率航",
                "symbolSize": 20,
                "category": "配角",
                "draggable": "true",
                "value": 214
            }, {
                "name": "王森",
                "symbolSize": 20,
                "category": "配角",
                "draggable": "true",
                "value": 215
            }, {
                "name": "庄小龙",
                "symbolSize": 20,
                "category": "配角",
                "draggable": "true",
                "value": 216
            }, {
                "name": "张永达",
                "symbolSize": 20,
                "category": "配角",
                "draggable": "true",
                "value": 217
            }, {
                "name": "动作指导",
                "value": 8,
                "symbolSize": 30,
                "category": "动作指导",
                "draggable": "true"
            }, {
                "name": "萨姆·哈格里夫",
                "symbolSize": 20,
                "category": "动作指导",
                "draggable": "true",
                "value": 81
            }, {
                "name": "黄伟亮",
                "symbolSize": 20,
                "category": "动作指导",
                "draggable": "true",
                "value": 82
            }, {
                "name": "后期导演",
                "value": 6,
                "symbolSize": 18,
                "category": "后期导演",
                "draggable": "true"
            }],
            links: [{
                "source": "战狼II",
                "target": "主演"
            }, {
                "source": "主演",
                "target": "张翰"
            }, {
                "source": "主演",
                "target": "吴京"
            }, {
                "source": "主演",
                "target": "吴刚"
            }, {
                "source": "主演",
                "target": "卢靖姗"
            }, {
                "source": "主演",
                "target": "弗兰克·格里罗"
            }, {
                "source": "战狼II",
                "target": "编剧"
            }, {
                "source": "编剧",
                "target": "董群"
            }, {
                "source": "编剧",
                "target": "刘毅"
            }, {
                "source": "编剧",
                "target": "吴京"
            }, {
                "source": "战狼II",
                "target": "制作人"
            }, {
                "source": "制作人",
                "target": "关海龙"
            }, {
                "source": "制作人",
                "target": "张苗"
            }, {
                "source": "制作人",
                "target": "嵇道表"
            }, {
                "source": "制作人",
                "target": "梁仁红"
            }, {
                "source": "制作人",
                "target": "冯郇"
            }, {
                "source": "制作人",
                "target": "陈永雄"
            }, {
                "source": "制作人",
                "target": "郑剑锋"
            }, {
                "source": "制作人",
                "target": "陈静"
            }, {
                "source": "制作人",
                "target": "成丽"
            }, {
                "source": "制作人",
                "target": "梁颖"
            }, {
                "source": "战狼II",
                "target": "出品人"
            }, {
                "source": "出品人",
                "target": "吴京"
            }, {
                "source": "出品人",
                "target": "宋歌"
            },  {
                "source": "出品人",
                "target": "吕建民"
            }, {
                "source": "出品人",
                "target": "徐子泉"
            },{
                "source": "出品人",
                "target": "关海龙"
            },{
                "source": "出品人",
                "target": "俞白眉"
            },{
                "source": "出品人",
                "target": "喇培康"
            },{
                "source": "出品人",
                "target": "薛继军"
            },{
                "source": "出品人",
                "target": "于冬"
            },{
                "source": "出品人",
                "target": "曾茂军"
            },{
                "source": "出品人",
                "target": "杨伟东"
            },{
                "source": "战狼II",
                "target": "策划"
            }, {
                "source": "策划",
                "target": "鲍晓曦"
            }, {
                "source": "策划",
                "target": "江平"
            }, {
                "source": "策划",
                "target": "赵海城"
            }, {
                "source": "策划",
                "target": "李洋"
            }, {
                "source": "策划",
                "target": "赵建军"
            }, {
                "source": "策划",
                "target": "许志湧"
            }, {
                "source": "策划",
                "target": "蒋德富"
            }, {
                "source": "策划",
                "target": "刘开珞"
            }, {
                "source": "策划",
                "target": "邓浩"
            }, {
                "source": "策划",
                "target": "吴燕"
            }, {
                "source": "策划",
                "target": "凌江"
            }, {
                "source": "策划",
                "target": "崔洁"
            }, {
                "source": "策划",
                "target": "孙文杰"
            }, {
                "source": "策划",
                "target": "陈庆奕"
            }, {
                "source": "策划",
                "target": "曲吉小江"
            }, {
                "source": "策划",
                "target": "朱昊"
            }, {
                "source": "策划",
                "target": "刘红焰"
            }, {
                "source": "策划",
                "target": "韩璐"
            }, {
                "source": "策划",
                "target": "秀一"
            }, {
                "source": "战狼II",
                "target": "导演"
            }, {
                "source": "导演",
                "target": "吴京"
            }, {
                "source": "战狼II",
                "target": "配角"
            }, {
                "source": "配角",
                "target": "丁海峰"
            }, {
                "source": "配角",
                "target": "于谦"
            }, {
                "source": "配角",
                "target": "淳于珊珊"
            },{
                "source": "配角",
                "target": "余男"
            },{
                "source": "配角",
                "target": "石兆琪"
            },{
                "source": "配角",
                "target": "狄安娜·希拉"
            },{
                "source": "配角",
                "target": "宋歌"
            },{
                "source": "配角",
                "target": "Nwachukwu Kennedy Chukwuebuka"
            },{
                "source": "配角",
                "target": "安·詹姆斯"
            },{
                "source": "配角",
                "target": "高明"
            },{
                "source": "配角",
                "target": "社建桥"
            },{
                "source": "配角",
                "target": "郭秋成"
            },{
                "source": "配角",
                "target": "程素"
            },{
                "source": "配角",
                "target": "孙率航"
            },{
                "source": "配角",
                "target": "王森"
            },{
                "source": "配角",
                "target": "庄小龙"
            },{
                "source": "配角",
                "target": "张永达"
            },{
                "source": "战狼II",
                "target": "动作指导"
            }, {
                "source": "动作指导",
                "target": "萨姆·哈格里夫"
            }, {
                "source": "动作指导",
                "target": "黄伟亮"
            }, {
                "source": "战狼II",
                "target": "后期导演"
            }, {
                "source": "后期导演",
                "target": "鲍晓曦"
            },],
            categories: [{
                'name': '主演'
            }, {
                'name': '编剧'
            }, {
                'name': '制作人'
            }, {
                'name': '出品人'
            }, {
                'name': '策划'
            }, {
                'name': '导演'
            }, {
                'name': '配角'
            }, {
                'name': '动作指导'
            }, {
                'name': '后期导演'
            }, {

            }],
            focusNodeAdjacency: true,
            roam: true,
            label: {
                normal: {

                    show: true,
                    position: 'top',

                }
            },
            lineStyle: {
                normal: {
                    color: 'source',
                    curveness: 0,
                    type: "solid"
                }
            }
        }]
    };

//    myChart.setOption(option);



    // 指定图表的配置项和数据
    option1 = {
        title : {
            text: '电影类型偏好',
            subtext: '南丁格尔玫瑰图',
            x:'center'
        },
        tooltip : {
            trigger: 'item',
            formatter: "{a} <br/>{b} : {c} ({d}%)"
        },
        legend: {
            x : 'center',
            y : 'bottom',
            data:['动作 51.3%','爱情 13.1%','喜剧 11%','科幻 10.4%','动画 5.5%','魔幻 4.4%','剧情 2.6%','惊悚 1.1%','战争 0.5%']
        },
        toolbox: {
            show : true,
            feature : {
                mark : {show: true},
                dataView : {show: true, readOnly: false},
                magicType : {
                    show: true,
                    type: ['pie', 'funnel']
                },
                restore : {show: true},
                saveAsImage : {show: true}
            }
        },
        calculable : true,
        series : [

            {
                name:'面积模式',
                type:'pie',
                radius : [30, 110],
                center : ['50%', '50%'],
                roseType : 'area',
                data:[
                    {value:513, name:'动作 51.3%'},
                    {value:131, name:'爱情 13.1%'},
                    {value:110, name:'喜剧 11%'},
                    {value:104, name:'科幻 10.4%'},
                    {value:55, name:'动画 5.5%'},
                    {value:44, name:'魔幻 4.4%'},
                    {value:26, name:'剧情 2.6%'},
                    {value:11, name:'惊悚 1.1%'},
                    {value:5, name:'战争 0.5%'},
                ]
            }
        ]
    };


    var data = [{
        value:496,
        name: '其他'
    }, {
        value: 359,
        name: '白领'
    }, {
        value: 145,
        name: '学生'
    }];
    option2 = {
        title: {
            text: '职业'
        },
        backgroundColor: 'rgba(255,255,255,0)',
        tooltip: {
            show: false,
            trigger: 'item',
            formatter: "{b}: {c} ({d}%)"
        },
        toolbox: {
            show: true,
            feature: {
                dataView: {readOnly: false},
                restore: {},
                saveAsImage: {}
            }
        },
        legend: {
            orient: 'horizontal',
            bottom: '0%',
            data: ['其他', '白领', '学生']
        },
        series: [{
            type: 'pie',
            selectedMode: 'single',
            radius: ['40%', '58%'],
            color: ['#AF89D6', '#59ADF3', '#FF999A', '#FFCC67','#FCC667','#CC5962'],

            label: {
                normal: {
                    position: 'inner',
                    formatter: '{d}%',

                    textStyle: {
                        color: '#fff',
                        fontWeight: 'bold',
                        fontSize: 12
                    }
                }
            },
            labelLine: {
                normal: {
                    show: false
                }
            },
            data: data
        }]
    };



    // 使用刚指定的配置项和数据显示图表。
//    myChart1.setOption(option1);
//    myChart2.setOption(option2);






//    var myChart3 = echarts.init(document.getElementById('main3'));
    // 基于准备好的dom，初始化echarts实例

    var xData = function() {
        var data = [];
        for (var i = 1; i < 13; i++) {
            data.push(i + "月");
        }
        return data;
    }();

    option3 = {
        "title": {
            "text": "电影类型统计",
            x: "4%",

            textStyle: {
                color: '#fff',
                fontSize: '22'
            },
            subtextStyle: {
                color: '#90979c',
                fontSize: '16',

            },
        },
        "tooltip": {
            "trigger": "axis",
            "axisPointer": {
                "type": "shadow",
                textStyle: {
                    color: "#fff"
                }

            },
        },
        "grid": {
            "borderWidth": 0,
            "top": 80,
            "bottom": 95,
            textStyle: {
                color: "#fff"
            }
        },
        "legend": {
            x: '4%',
            top: '11%',
            textStyle: {
                color: '#90979c',
            },
            "data": ['动作', '爱情', '喜剧','科幻','动画']
        },


        "calculable": true,
        "xAxis": [{
            "type": "category",
            "axisLine": {
                lineStyle: {
                    color: '#90979c'
                }
            },
            "splitLine": {
                "show": false
            },
            "axisTick": {
                "show": false
            },
            "splitArea": {
                "show": false
            },
            "axisLabel": {
                "interval": 0,

            },
            "data": xData,
        }],
        "yAxis": [{
            "type": "value",
            "splitLine": {
                "show": false
            },
            "axisLine": {
                lineStyle: {
                    color: '#90979c'
                }
            },
            "axisTick": {
                "show": false
            },
            "axisLabel": {
                "interval": 0,

            },
            "splitArea": {
                "show": false
            },

        }],
        "dataZoom": [{
            "show": true,
            "height": 30,
            "xAxisIndex": [
                0
            ],
            bottom: 30,
            "start": 0,
            "end": 120,
            handleIcon: 'path://M306.1,413c0,2.2-1.8,4-4,4h-59.8c-2.2,0-4-1.8-4-4V200.8c0-2.2,1.8-4,4-4h59.8c2.2,0,4,1.8,4,4V413z',
            handleSize: '110%',
            handleStyle:{
                color:"#d3dee5",

            },
            textStyle:{
                color:"#fff"},
            borderColor:"#90979c"


        }, {
            "type": "inside",
            "show": true,
            "height": 15,
            "start": 1,
            "end": 35
        }],
        "series": [{
            "name": "动作",
            "type": "bar",
            "stack": "",
            "barMaxWidth": 35,
            "barGap": "10%",
            "itemStyle": {
                "normal": {
                    "color": "rgba(255,144,128,1)",
                    "label": {
                        "show": true,
                        "textStyle": {
                            "color": "#fff"
                        },
                        "position": "insideTop",
                        formatter: function(p) {
                            return p.value > 0 ? (p.value) : '';
                        }
                    }
                }
            },
            "data": [
                67779.9,
                75016.1,
                69987.2,
                87513.6,
                58711.6,
                76319.7,
                62259.5,
                76169.0,
                88993.2,
                69351.9,
                51605.7,
                69926.0,
            ],
        },

            {
                "name": "爱情",
                "type": "bar",
                "stack": "",
                "itemStyle": {
                    "normal": {
                        "color": "rgba(0,191,183,1)",
                        "barBorderRadius": 0,
                        "label": {
                            "show": true,
                            "position": "top",
                            formatter: function(p) {
                                return p.value > 0 ? (p.value) : '';
                            }
                        }
                    }
                },
                "data": [
                    15825.3,
                    23174.4,
                    20375.2,
                    21298.4,
                    16284,
                    17062.8,
                    23685.1,
                    16707.6,
                    19658.3,
                    20865.1,
                    21298.4,
                    19244.5
                ]
            }, {
                "name": "喜剧",
                "type": "bar",
                "stack": "",
                "itemStyle": {
                    "normal": {
                        "color": "rgba(0,129,194,214)",
                        "barBorderRadius": 0,
                        "label": {
                            "show": true,
                            "position": "top",
                            formatter: function(p) {
                                return p.value > 0 ? (p.value) : '';
                            }
                        }
                    }
                },
                "data": [
                    18926.4,
                    13774.4,
                    15676.7,
                    19803.8,
                    16469.4,
                    19720.8,
                    15624.8,
                    21109.9,
                    16718.9,
                    21654.8,
                    20039.6,
                    17438.8,
                ]
            }, {
                "name": "科幻",
                "type": "bar",
                "stack": "",
                "itemStyle": {
                    "normal": {
                        "color": "rgba(0,129,146,214)",
                        "barBorderRadius": 0,
                        "label": {
                            "show": true,
                            "position": "top",
                            formatter: function(p) {
                                return p.value > 0 ? (p.value) : '';
                            }
                        }
                    }
                },
                "data": [
                    14739.3,
                    15736.3,
                    13634.5,
                    20687.1,
                    19093.6,
                    11589.7,
                    17156.2,
                    11307.9,
                    16579,
                    14035.1,
                    13346.8,
                    12171.3,
                ]
            }, {
                "name": "动画",
                "type": "bar",
                "stack": "",
                "itemStyle": {
                    "normal": {
                        "color": "rgba(0,217,179,230)",
                        "barBorderRadius": 0,
                        "label": {
                            "show": true,
                            "position": "top",
                            formatter: function(p) {
                                return p.value > 0 ? (p.value) : '';
                            }
                        }
                    }
                },
                "data": [
                    7871.2,
                    5609.2,
                    8154.5,
                    7099.9,
                    6306.8,
                    6885.8,
                    7228.5,
                    8659.7,
                    10369.3,
                    10393.4,
                    9162.7,
                    7866.7
                ]
            }
        ]
    };

//    myChart3.setOption(option3);



// 基于准备好的dom，初始化echarts实例



function bn0() {
    document.getElementById('main').value="";
    myChart = echarts.init(document.getElementById('main'));
    myChart.setOption(option0, true);
}

    function bn1() {
        document.getElementById('main').value="";
//        myChart = echarts.init(document.getElementById('main'));
//        myChart.setOption(option, true);
        var uploadedDataURL = "/echarts/data-1499235712572-BkKKrbcNZ.gexf";
        myChart = echarts.init(document.getElementById('main'));
        myChart.showLoading();
        $.get(uploadedDataURL, function(xml) {
            myChart.hideLoading();

            var graph = echarts.dataTool.gexf.parse(xml);
            var categories = [];
            for (var i = 0; i < 9; i++) {
                categories[i] = {
                    name: '' + i
                };
            }
            graph.nodes.forEach(function(node) {
                node.itemStyle = null;
                node.value = node.symbolSize;
                node.label = {
                    normal: {
                        show: node.symbolSize > 0
                    }
                };
                node.category = node.attributes.modularity_class;
            });
            option4 = {
                title: {
                    text: '《天龙八部》人物关系图',
                    subtext: 'Default layout',
                    top: 'bottom',
                    left: 'right'
                },
                tooltip: {},
                legend: [{
                    // selectedMode: 'single',
                    data: categories.map(function(a) {
                        return a.name;
                    })
                }],
                animationDuration: 1500,
                animationEasingUpdate: 'quinticInOut',
                series: [{
                    name: '天龙八部',
                    type: 'graph',
                    layout: 'force',
                    data: graph.nodes,
                    links: graph.links,
                    categories: categories,
                    focusNodeAdjacency: true,
                    roam: true,
                    label: {
                        normal: {
                            position: 'right',
                            formatter: '{b}'
                        }
                    },
                    lineStyle: {
                        normal: {
                            curveness: 0.1,
                            color: 'source',
                        }
                    },
                    force: {
                        repulsion: 650,
                        gravity: 0.25,
                        edgeLength: [100,150]
                    },
                }]
            };

            myChart.setOption(option4, true);
        }, 'xml');


    }

function bn2() {
    document.getElementById('main').value="";
    myChart = echarts.init(document.getElementById('main'));
    myChart.setOption(option1, true);
}
function bn3() {
    document.getElementById('main').value="";
    myChart = echarts.init(document.getElementById('main'));
    myChart.setOption(option2, true);
}
function bn4() {
    document.getElementById('main').value="";
    myChart = echarts.init(document.getElementById('main'));
    myChart.setOption(option3, true);
}

function bn5() {
    document.getElementById('main').value="";
    myChart = echarts.init(document.getElementById('main'));

    var uploadedDataURL = "/echarts/data-1495595908173-rk2KsOfWb.json";

    $.getJSON(uploadedDataURL, function(linedata) {
        var data = linedata[0]
        var links = linedata[1]
        var categories = linedata[2]
        var cont = linedata[3]
        var mid = linedata[4]
        var user1 = linedata[5]
        option5 = {

            title: {
                text: "微博转发关系图",
                subtext: '@' + user1 + ':' + cont,
                sublink: 'http://m.weibo.cn/status/' + mid,
                top: "top",
                left: "center"
            },

            tooltip: {},

            toolbox: {
                show: true,
                feature: {
                    dataView: {
                        show: true,
                        readOnly: true
                    },
                    restore: {
                        show: true
                    },
                    saveAsImage: {
                        show: true
                    }
                }
            },
            animationDuration: 1500,
            animationEasingUpdate: 'quinticInOut',
            series: [{
                name: '微博',
                type: 'graph',
                layout: 'force',

                force: {
                    //initLayout:'circular'
                    edgeLength: 50,
                    repulsion: 50,
                    gravity: 0.2
                },
                data: data,
                edges: links,
                categories: categories,
                focusNodeAdjacency: true,
                roam: true,
                label: {
                    normal: {
                        position: 'right',
                        formatter: '{b}'
                    }
                },
                lineStyle: {
                    normal: {
                        //color: 'target',
                        curveness: 0
                    }
                }
            }]
        };
        myChart.setOption(option5, true);
    })



}

</script>

</body>

</html>